﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace SharpSoft.WPF.WriteableBitmapModules
{
    public struct PointInt32
    {
        public PointInt32(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
        public int X { get; set; }

        public int Y { get; set; }

        public Point ToPoint()
        {
            return new Point(X, Y);
        }

        public void FromPoint(Point p)
        {
            this.X = (int)Math.Round(p.X, 0);
            this.Y = (int)Math.Round(p.Y, 0);
        }
    }
    public struct SizeInt32
    {
        public SizeInt32(int width, int height)
        {
            this.Width = width;
            this.Height = height;
        }
        public int Width { get; set; }
        public int Height { get; set; }
    }
    public struct GridInfo
    {
        public GridInfo(int cols, int rows)
        {
            this.Rows = rows;
            this.Columns = cols;
        }
        /// <summary>
        /// 设置行数列数相同
        /// </summary>
        /// <param name="rowsAndcols"></param>
        public GridInfo(int rowsAndcols)
        {
            this.Rows = rowsAndcols;
            this.Columns = rowsAndcols;
        }
        public int Rows { get; set; }

        public int Columns { get; set; }
    }
}
